/**********************************************************************************************************************
 *
 * Project:    mGameEngine
 * File:       list.h
 * Author:     karooolek
 * Created on: 2008-12-30
 *
 **********************************************************************************************************************/

#ifndef LIST_H_
#define LIST_H_

#include "types.h"
#include <list>

namespace mGameEngine
{

/**
 * List container.
 * Elements in list are not packed.
 * They can be accessed only by using iterators.
 */
template<typename TVal>
class List : public std::list<TVal>
{
public:
    /**
     * List iterator.
     */
    typedef typename std::list<TVal>::iterator Iterator;

    /**
     * List const iterator.
     */
    typedef typename std::list<TVal>::const_iterator ConstIterator;

    /**
     * Create empty list.
     */
    List() : std::list<TVal>()
    {
    }

    /**
     * Create list with initial size.
     * @param size initial size
     */
    List(uint size) : std::list<TVal>(size)
    {
    }

    /**
     * Create list with initial values.
     * @param size initial size
     * @param initVal initial value
     */
    List(uint size, const TVal &initVal) : std::list<TVal>(size, initVal)
    {
    }

    /**
     * Copy constructor.
     * @param l List to copy
     */
    List(const List &l) : std::list<TVal>(l)
    {
    }
};

}

#endif // LIST_H_
